﻿package {
	import flash.display.Sprite;
	import flash.display.GradientType;
	import flash.geom.Matrix;
			
	public class StepForwardButton extends Sprite {
		public var scale: Number;
		public var matrix:Matrix = new Matrix;
		public var red: Boolean;
		public var up: Boolean;
	 			
		public function StepForwardButton() 
		{
			draw(30, true, false);
		}
		
		public function draw(scale:Number, up:Boolean, red:Boolean):void
		{
			
			graphics.clear();
			matrix.createGradientBox(0.95*scale, 0.8*scale, Math.PI/2,  0, 0);
			if(up)
			{
			graphics.beginGradientFill(GradientType.LINEAR, [0xffffff, 0x777777], [1,1], [0,255], matrix);
			}
			else
			{
			graphics.beginGradientFill(GradientType.LINEAR, [0x777777, 0xffffff], [1,1], [0,255], matrix);
			}
			
			graphics.lineStyle(0, 0xffffff, 0);
			graphics.moveTo(0, 0);
			graphics.lineTo(0.55*scale, 0);
			graphics.curveTo(0.75*scale, 0, 0.75*scale, 0.2*scale);
			graphics.lineTo(0.75*scale, 0.6*scale);
			graphics.curveTo(0.75*scale, 0.8*scale, 0.55*scale, 0.8*scale);
			graphics.lineTo(0, 0.8*scale);
			graphics.lineTo(0, 0);
			
			graphics.endFill();
						
            matrix.createGradientBox(0.45*scale, 0.5*scale, Math.PI/2, 0.3*scale, 0.15*scale);
									
			if(red)
			{
			graphics.beginGradientFill(GradientType.LINEAR, [0xee0000, 0x770000], 
			[1,1], [0,255], matrix);
			}
			else
			{
			graphics.beginGradientFill(GradientType.LINEAR, [0xdddddd, 0x000000], 
			[1,1], [0,255], matrix);
			}
			
			graphics.lineStyle(0, 0x000000, 1);
			graphics.moveTo(0.15*scale, 0.6*scale);
			graphics.lineTo(0.15*scale, 0.2*scale);
			graphics.lineTo(0.25*scale, 0.2*scale);
			graphics.lineTo(0.25*scale, 0.6*scale);
			graphics.lineStyle(0, 0xffffff, 1);
			graphics.lineTo(0.15*scale, 0.6*scale);
			
			graphics.lineStyle(0, 0xdddddd, 1);
			graphics.moveTo(0.30*scale, 0.6*scale);
			graphics.lineTo(0.55*scale, 0.4*scale);
			graphics.lineStyle(0, 0x000000, 1);
			graphics.lineTo(0.30*scale, 0.2*scale);
			graphics.lineStyle(0, 0x000000, 1);
			graphics.lineTo(0.30*scale, 0.6*scale);
			
			graphics.endFill();
			
			
	}
			
	}
						
		}
		
		

